Add File Type Support When Open File and Update Test Project to NET 8#393
Add File Type Support When Open File and Update Test Project to NET 8#393levnach merged 3 commits intomicrosoft:masterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for multiple file types (MSAGL, DOT, and DGML) in the file open dialog and updates the test projects from .NET 6 to .NET 8.
- Updates target framework from .NET 6 to .NET 8 for test projects
- Adds DGML file type support by integrating DgmlParser
- Enhances file type detection and parsing logic with extension-based routing
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| TestGraphmaps.csproj | Updates target framework to net8.0-windows |
| TestFormForGViewer.csproj | Adds DgmlParser project reference |
| FormStuff.cs | Implements multi-format file support with extension-based parsing |
| MSAGLTests.csproj | Updates target framework to net8.0-windows |
| Program.cs | Adds STAThread attribute and System using |
| build.yml | Updates test path to reflect net8.0-windows framework |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
| msaglFile = false; | ||
| return null; | ||
| return graph; |
There was a problem hiding this comment.
The function can return null when all parsing attempts fail, but the method signature doesn't indicate this possibility. Consider returning a default empty graph or updating the method signature to make the nullable return explicit.
| return graph; | |
| return graph ?? new Graph(); |
| catch (Exception) { | ||
| System.Diagnostics.Debug.WriteLine("cannot read " + fileName); | ||
| } |
There was a problem hiding this comment.
Catching generic Exception without re-throwing or proper error handling can mask important errors. Consider catching specific exceptions or logging more detailed error information for debugging.
| catch (Exception) { | ||
| System.Diagnostics.Debug.WriteLine("cannot read " + fileName); | ||
| } |
There was a problem hiding this comment.
Catching generic Exception without re-throwing or proper error handling can mask important errors. Consider catching specific exceptions or logging more detailed error information for debugging.
| } | ||
| break; | ||
| case ".msagl": | ||
| default: |
There was a problem hiding this comment.
The default case assumes MSAGL format for unknown extensions, which may not be intuitive. Consider adding explicit handling for .msagl extension and making the default case more explicit about fallback behavior.
Support msagl, dot, dmgl. Then we can enrich it to one viewer/editor based on current test01.